import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  //登录
  {
    path: "/login",
    component: () => import("@/views/basic/login/index.vue"),
  },
  //注册
  {
    path: "/register",
    component: () => import("@/views/basic/register/index.vue"),
  },
  //企业商家
  {
    path: "/business",
    component: () => import("@/views/basic/business/index.vue"),
  },
  //商品详情
  {
    path: "/goods",
    component: () => import("@/views/basic/goods/index.vue"),
  },
  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    children: [
      //首页
      {
        path: "/",
        name: "首页",
        component: () => import("@/views/index.vue"),
      },
      // 发布代理
      {
        path: "/agent",
        name: "发布代理",
        component: () => import("@/views/agent/index.vue"),
      },
      // 所有产品
      {
        path: "/product",
        name: "所有产品",
        component: () => import("@/views/product/index.vue"),
      },
      // 企业大全
      {
        path: "/enterprise",
        name: "企业大全",
        component: () => import("@/views/enterprise/index.vue"),
      },
      // 我要代理
      {
        path: "/proxy",
        name: "我要代理",
        component: () => import("@/views/proxy/index.vue"),
      },
      // 我要招商
      {
        path: "/merchant",
        name: "我要招商",
        component: () => import("@/views/merchant/index.vue"),
      },
      // OEM代加工
      {
        path: "/processing",
        name: "OEM代加工",
        component: () => import("@/views/processing/index.vue"),
      },
      // 连锁加盟
      {
        path: "/franchise",
        name: "连锁加盟",
        component: () => import("@/views/franchise/index.vue"),
      },
      //联系我们
      {
        path: "/contact",
        name: "联系我们",
        component: () => import("@/views/contact/index.vue"),
      },
      //行业资讯
      {
        path: "/industry",
        name: "行业资讯",
        component: () => import("@/views/industry/index.vue"),
      },
      //资讯详情
      {
        path: "/industryDetail/:id",
        name: "资讯详情",
        props: true,
        component: () => import("@/views/industry/details/index.vue"),
      },
      //客户好评
      {
        path: "/praise",
        name: "客户好评",
        component: () => import("@/views/praise/index.vue"),
      },
      // 广告申请
      {
        path: "/advertising",
        name: "广告申请",
        component: () => import("@/views/advertising/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
